package com.Jano.dao.Impl;

import com.Jano.dao.ChoiceDao;
import com.Jano.entity.Choice;

import java.util.List;

/**
 * description: ChoiceDaoImpl <br>
 * date: 2022/6/6 4:51 PM <br>
 * author: zoumaoji <br>
 * version: 1.0 <br>
 */
public class ChoiceDaoImpl extends AbstractDaoImpl implements ChoiceDao {
    @Override
    public void createChoice(int questionId, String content, String ord) {
        update("insert into t_choice (ord,content,question_id) values(?,?,?)",new Object[]{ord,content,questionId});
    }

    @Override
    public List<Choice> selectChoicesByQuestionId(int questionId) {
        return queryForList("select id choiceId,ord,content,question_id questionId from t_choice where question_id =?",Choice.class,new Object[]{questionId});
    }
}
